using namespace std;

#ifndef myObject3D_H
#define myObject3D_H

	#include <math.h>
	#include <GL/glew.h>
	#include <iostream>
	#include <fstream>
	#include <string>
	#include <vector>
	#include "myTexture.h"
	#include "Material.h"
	#include "Object3DGroup.h"
	#include "ShaderManager.h"

	#ifndef PI
	   #define PI 3.14159265358979323846
	#endif

	class myObject3D
	{
	public:
		int n, m;
		string name;

		GLuint buffers[6];
		vector<GLfloat> vertices;
		vector<GLfloat> colors;
		vector<GLuint> indices;
		vector<GLfloat> normals;
		vector<GLfloat> textures;
		vector<GLfloat> tangents;
		
		Material *material;

		vector<Object3DGroup*> groups;
  
		myObject3D(void);
		~myObject3D(void);

		void init();
		void normalize();
		void computeNormal(int v1, int v2, int v3, float & x, float & y, float & z);
		void computeNormals( );
		void createObjectBuffers();
		void displayObject();
		void displayNormals();
		void computeCylinderTexture();
		void computeSphereTexture();
		void computeTangents();
		void computeTangent(int v0, int v1, int v2, float & x, float & y, float & z);
	};

#endif